home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / ab20_archive / languages / assembly / powervisor_113.lzh / s / pv / cmd.pv < prev    next >
Text File  |  1991-09-17  |  788b  |  39 lines

  1. /*=======================================================*/
  2. /*                                                                            */
  3. /* Execute cli commands from within PowerVisor        V1.0    */
  4. /*                                                                            */
  5. /* © Jorrit Tyberghein  17 Sep 1991                                */
  6. /*                                                                            */
  7. /*=======================================================*/
  8.  
  9. options results
  10.  
  11. 'string rc'
  12. cmd=result
  13.  
  14. ti=pragma('Id')
  15.  
  16. address command cmd '>t:cmd'ti
  17. if rc~=0 then
  18.     do
  19.         'print "Command failed with returncode' rc '!\0a"'
  20.         address command 'delete t:cmd'ti' >nil:'
  21.         exit
  22.     end
  23. if ~open(file,'t:cmd'ti,'R') then
  24.     do
  25.         address command 'delete t:cmd'ti' >nil:'
  26.         'print "Error opening file !\0a"'
  27.         exit
  28.     end
  29.  
  30. line=readln(file)
  31. do while ~eof(file)
  32.     'print "·Å'line'Å\0a"'
  33.     line=readln(file)
  34. end
  35.  
  36. call close file
  37. address command 'delete t:cmd'ti' >nil:'
  38. exit
  39.